package org.sklse.learningassistant.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.sklse.learningassistant.bean.Wish;
import org.sklse.learningassistant.service.WishService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Habit")
public class WishController {

	@Resource
	private WishService wishService;
	
	@ResponseBody 
	  @RequestMapping("/getWish")
	public List<Wish> getWish(HttpServletResponse response) {
		//服务器端跨域的配置,允许跨域
	    response.setHeader("Access-Control-Allow-Origin","*");  
		return wishService.getWish();
	}
	

}
